<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>7-触发事件trigger</title>
		<script type="text/javascript" src="js/jquery2.1.4.min.js"></script>
	</head>
	<body>
		<input type="text" placeholder="请输入关键字" name="keyword"><button>搜索</button>
		<script type="text/javascript">
			$(function(){
				//触发获取input的焦点事件
				$('input[name=keyword]').trigger('focus');
			});
		</script>
	</body>
</html>
